<?php

namespace App\Http\Controllers;
use DB;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

class TestController extends BaseController
{
    public function index(){
        header("Content-type:text/html;charset=utf-8");
        $city=DB::table('city')->where('city_type',2)->limit(10)->get();
    	return view('test',['city'=>$city]);
    }
    public function classes(){
        $city_id=$_POST['grade'];
        //echo $city_id;die;
        $class=DB::table('city')->where("parent_id",$city_id)->get();
       echo json_encode($class);  
    }
}
